package cn.codeforfun.initialization.common;

import cn.codeforfun.initialization.server.model.ServerRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author wangbin
 */
@Service
public class CommonService {
    @Resource
    ServerRepository serverRepository;

    List<DashboardInformation> getDashboardInformation() {
        long count = serverRepository.count();
        List<DashboardInformation> list = new ArrayList<>();
        list.add(new DashboardInformation("连接服务器", count > 0, "/server"));
        list.add(new DashboardInformation("创建集群", false, "/cluster"));
        list.add(new DashboardInformation("创建项目", false, "/project"));
        list.add(new DashboardInformation("部署应用", false, "/app"));
        list.add(new DashboardInformation("前台展示", false, "/endpoint"));
        return list;
    }
}
